//
//  receivePersonInfo.m
//  tcpoctest
//
//  Created by gump on 5/24/13.
//  Copyright (c) 2013 gump. All rights reserved.
//

#import "receivePersonInfo.h"

#import "userdb.h"

@implementation receivePersonInfo

-(void)processreceive
{
    [DataControl shareControl].personDS.uinfo.name = [logicsb ReadUnencodeString];
    [DataControl shareControl].personDS.uinfo.sex = [logicsb ReadChar];
    [DataControl shareControl].personDS.uinfo.age = [logicsb ReadChar];
    [DataControl shareControl].personDS.uinfo.province = [logicsb ReadChar];
    [DataControl shareControl].personDS.uinfo.city = [logicsb ReadChar];
    [DataControl shareControl].personDS.uinfo.needcheck = [logicsb ReadChar];
    [DataControl shareControl].personDS.uinfo.iCoin =
    [logicsb ReadIntWithTT:NTT_BIG2SMALL];
    [DataControl shareControl].personDS.uinfo.ppNumber = [logicsb ReadIntWithTT:NTT_BIG2SMALL];
    
    setLocalPP([DataControl shareControl].personDS.uinfo.ppNumber);
    
    [DataControl shareControl].personDS.uinfo.iGlamour = [logicsb ReadIntWithTT:NTT_BIG2SMALL];
    [DataControl shareControl].personDS.uinfo.mymail = [logicsb ReadUnencodeString];
    
    if(logicsb.mrestLength > 0)
    {
        [DataControl shareControl].personDS.uinfo.strSign = [logicsb ReadUnencodeString];
    }
    
    [DataControl shareControl].personDS.uinfo.cDisturb = [logicsb ReadChar];
    
    [[DataControl shareControl] SetUpdateUserType:UUT_ALL];
    [[DataBaseCtrol shareControl].userdatabase updateUserInfo];
    
    [[DataControl shareControl].UICommendDS addUICommand:UC_REFRESHCURVIEW];
    
    if ([DataControl shareControl].bfirstlogin) {
        [[DataControl shareControl].UICommendDS addUICommand:UC_ONLINEP_INITSWITCH];
        [DataControl shareControl].bfirstlogin = false;
    }
    
    [self ShowLog];
}

@end
